<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图片懒加载</title>
    <style>
        .content {
            width: 960px;
            margin: 0 auto;
            text-align: center;
        }
        .demoImg {
            vertical-align: middle;
            height: 100px;
            width: 100px;
            display: block;
            margin-bottom: 20px;
        }
    </style>
</head>
<body>
    <div class="content">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
        <img class="demoImg lazyImg" src="default.png" data-src="http://ww4.sinaimg.cn/large/006y8mN6gw1fa5obmqrmvj305k05k3yh.jpg" alt="">
    </div>
 </body>
 <script src="./index.js"></script>
 <script>
     new LazyLoad('default.png', '.lazyImg', 500);
 </script>
</html>